<template>
  <div>
  </br>
    <el-row>
      <el-col :span="4"style="margin-left:10px">
             <el-button
               type="warning"
               plain
               icon="el-icon-download"
               size="mini"
               @click="handleExport"
             >导出
             </el-button>
           </el-col>
    </el-row>
  </br>
       <!-- 表格 -->
       <el-table v-loading="loading" :data="stuList" @selection-change="handleSelectionChange">
      <el-table-column label="昵称" align="center" prop="name" />
      <el-table-column label="手机号" align="center" prop="phone" width="150" />
      <el-table-column label="优惠卷金额" align="center" prop="favorable" width="150" />
      <el-table-column label="购买类型" align="center" prop="type">
        <template slot-scope="scope">
          <span>{{ scope.row.type === 1 ? "月卡" : scope.row.type === 2 ? "季卡" : scope.row.type === 3 ? "年卡" : null }}</span>
        </template>
      </el-table-column>
      <el-table-column label="付费金额" align="center" prop="amount" />
      <el-table-column label="支付时间" align="center" prop="paymentDate" />
      <el-table-column label="到期时间" align="center" prop="maturityTime" width="100" />
      <el-table-column label="指导老师" align="center" prop="mobile" width="150" />
      <el-table-column label="实际支付" align="center" prop="payment" />
    </el-table>
  </div>
</template>

<script>
export default {
data(){
    return {
        stuList:null,
        queryParams:{
          pageNum: 1,
        pageSize: 10,

        }
    }
},
created() {
    this.stuList = JSON.parse(localStorage.getItem('stuList'))
  },
methods:{
   /** 导出按钮操作 */
   handleExport() {
    let code = localStorage.getItem('code');
    let start = localStorage.getItem('start');
    let end = localStorage.getItem('end');
    // code = Number(code)
    code = code.replace(/\"/g, '');
      this.download('/backstage/sys/derive/student', {code:code,start:start,end:end
      }, `stuList_${new Date().getTime()}.xlsx`)
    },
}
}
</script>

<style>

</style>